package com.hd.quartz.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * <h3>partitionjob</h3>
 * <p>entity.ScheduleJobEntity</p>
 *
 * @author : hduong
 * @version : 1.0
 * @date : 2020-09-11 16:22
 **/
@Data
@TableName("schedule_job")
public class ScheduleJobEntity  implements Serializable{

    private static final long serialVersionUID = 7554979707957332858L;

    /**
     * 定时调度 任务实体
     * 1: 任务参数
     * 2: 任务id
     * 3: 任务bean名字
     * 4: 方法
     * 5: 参数
     * 6: cron 表达式
     * 7: 状态
     * 8: 备注
     * 9: 创建时间
     * 10: 是否是批处理任务
     */

    @TableId
    private Long jobId;

    @NotBlank(message = "beanName不能为空")
    private String beanName;

    @NotBlank(message = "方法名称不能为空")
    private String methodName;
    private String params;

    @NotBlank(message = "cron表达式不能为空")
    private String cronExpression;
    private Integer status;
    private String remark;
    private Date createTime;
    private Integer isBatchJob;

    /**
     * 任务调度参数key
     */
    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";

    /**
     * 批量任务参数
     */
    public static final String BATCH_JOB_KEY = "job";
    public static final String BATCH_JOB_LAUNCHER_KEY = "jobLauncher";





}
